# -*- coding: UTF-8 -*-
# Author: Damon(wuud1)
# CreateDate: 
# Message:

str = '2000 CC >5 SPEED MT 4WD >2 SPEED 4WD'
def clean(str):
    str_l = str.split(">")
    SPEED_l = []
    mL_l = []
    other_l = []
    for i in str_l:
        if 'WD' in i.upper().replace(" ", "") or "SPEED" in i.upper().replace(" ", ""):
            SPEED_l.append(i)
        elif 'CC' in i.upper().replace(" ", ""):
            mL_l.append(i)
        else:
            if i != "":
                other_l.append(i)
    _dict = {
        "SPEED": SPEED_l[0] if len(SPEED_l)==1 else "",
        "mL":mL_l[0] if len(mL_l)==1 else "",
        "other":' >'.join(other_l)
    }
    return _dict

print(clean(str))


